(function(){
    angular.module('app')
        .factory('mockHttp', fn);

    function fn(){
        var self = {};
        self.allDrug = {
            msg:'',
            err:0,
            res:[
                {'drugName':'感康','price':10,'treat':'感冒、流鼻涕','drugId':1,'stockNumber':100,'img':'./src/images/tmp.jpg'},
                {'drugName':'白加黑','price':15,'treat':'感冒','drugId':2,'stockNumber':100, 'img':'./src/images/tmp.jpg'},
                {'drugName':'999感冒灵','price':20,'treat':'感冒','drugId':3,'stockNumber':100, 'img':'./src/images/tmp.jpg'},
                {'drugName':'吗丁啉','price':8,'treat':'消化不良','drugId':4,'stockNumber':100, 'img':'./src/images/tmp.jpg'}
            ]
        };

        self.users = {
            c: {
                username:'c',
                userType: 'CUSTOMER',
                token: 'whosyourdaddy',
                shopId:null,
                profile: {
                    nickName: '',
                    address: ''
                }
            },
            dm:{                                //药店管理员
                username:'dm',
                userType: 'STORE_MANAGER',
                token: 'whosyourdaddy',
                shopId:1,
                profile: {
                    nickName: '',
                    address: ''
                }
            },
            sm:{                              //系统管理员
                username:'sm',
                userType: 'SYSTEM_MANAGER',
                token: 'whosyourdaddy',
                shopId:null,
                profile: {
                    nickName: '',
                    address: ''
                }
            }
        };

        self.orderInfo = {
            orderId:1,
            status:'等待处理',
            time:'2018-5-9 11:21',
            pharmacy:'复美大药房',
            pharmacyPhone:'1234567',
            distance:'2km',
            username:'严婷',
            phone:'13122036169',
            address:'上海市奉贤区华东理工大学',
            deliveryFee:4,
            totalPrice:30,
            items:[
                {
                    drugName:'感康',
                    number:2,
                    price:16
                }, {
                    drugName:'白加黑',
                    number:1,
                    price:10
                }
            ]
        };

        self.orderList = [
            {
                orderId:1,
                pharmacy: '复美大药房海湾店',
                pharmacyPhone: '123456',
                username:'严婷',
                address:'上海市奉贤区华东理工大学',
                price: 30,
                time: '2018-5-9 22:20'
            },{
                orderId:2,
                pharmacy: '东亚医药超市',
                pharmacyPhone: '123456',
                username:'严婷',
                address:'上海市奉贤区华东理工大学',
                price: 27,
                time: '2018-5-8 22:20'
            },{
                orderId:3,
                pharmacy: '东亚医药超市',
                pharmacyPhone: '123456',
                username:'严婷',
                address:'上海市奉贤区华东理工大学',
                price: 27,
                time: '2018-5-8 22:20'
            },{
                orderId:4,
                pharmacy: '东亚医药超市',
                pharmacyPhone: '123456',
                username:'严婷',
                address:'上海市奉贤区华东理工大学',
                price: 27,
                time: '2018-5-8 22:20'
            },{
                orderId:5,
                pharmacy: '东亚医药超市',
                pharmacyPhone: '123456',
                username:'严婷',
                address:'上海市奉贤区华东理工大学',
                price: 27,
                time: '2018-5-8 22:20'
            },{
                orderId:6,
                pharmacy: '东亚医药超市',
                pharmacyPhone: '123456',
                username:'严婷',
                address:'上海市奉贤区华东理工大学',
                price: 27,
                time: '2018-5-8 22:20'
            },{
                orderId:7,
                pharmacy: '东亚医药超市',
                pharmacyPhone: '123456',
                username:'严婷',
                address:'上海市奉贤区华东理工大学',
                price: 27,
                time: '2018-5-8 22:20'
            },{
                orderId:8,
                pharmacy: '东亚医药超市',
                pharmacyPhone: '123456',
                username:'严婷',
                address:'上海市奉贤区华东理工大学',
                price: 27,
                time: '2018-5-8 22:20'
            }
        ];


        return self;
    }
})()
